import request from "@/utils/request";
const BASE_URL = "/salvage/accidentAlert";

// 获得列表
export function queryList(query) {
    return request({
        url: BASE_URL,
        method: "get",
        params: query,
    });
}
// 新建
export function createOne(data) {
    return request({
        url: BASE_URL,
        method: "post",
        data: data,
    });
}
// 查询
export function getOne(id) {
    return request({
        url: BASE_URL + "/" + id,
        method: "get",
    });
}
// 删除
export function deleteOne(id) {
    return request({
        url: BASE_URL + "/" + id,
        method: "delete",
    });
}
// 修改
export function updateOne(data) {
    return request({
        url: BASE_URL,
        method: "put",
        data: data,
    });
}
// 获得最新列表
export function queryLastList(query) {
    return request({
        url: BASE_URL + '/latestList',
        method: "get",
        params: query,
    });
}
// 查询某个井的最新记录
// export function queryLastOne(wellId) {
//     return request({
//         url: "/salvage/" + wellId + '/accidentAlert/latest',
//         method: "get",
//     });
// }
export default {
    createOne,
    getOne,
    queryList,
    deleteOne,
    updateOne,
    queryLastList
}

